<template>
    <a-card :bordered="false">
        <div class="table-operator">
            <a-button shape="round" size="small" type="primary" icon="plus" @click="handleEdit({},'contractTemplateAdd','新增合同模板')">添加</a-button>
        </div>

        <LTable
        ref="contractTemplateList"
        size="small"
        rowKey="keyId"
        :formAttributes="formAttributes"
        :columns="columns"
        axiosUrl="/WxContractTemplateController/page"
        :showPagination="true"
        :showQueryForm="true"
      >
        <a-icon type="check-circle" />
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record,'contractTemplateEdit','合同模板在线编辑')">编辑</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete({keyId:record.keyId},'/WxContractTemplateController/del','contractTemplateList')">
                  <a>删除</a>
            </a-popconfirm>
        </span>
        
    </LTable>
    <contractTemplateEdit ref="contractTemplateEdit" @close="refresh('contractTemplateList')" @ok="refresh('contractTemplateList')"></contractTemplateEdit> 
    <contractTemplateAdd ref="contractTemplateAdd" @close="refresh('contractTemplateList')" @ok="refresh('contractTemplateList')"></contractTemplateAdd>
    </a-card>
</template>

<script>
import LTable from '@/components/lt/LTable'
import request from '@/utils/request'
import contractTemplateEdit from './contractTemplateEdit'
import contractTemplateAdd from './contractTemplateAdd'
import {SysMixin} from '@/mixins/SysMixin'
import defaultSettings from '@/config/defaultSettings'
export default {
    name:'contractTemplateList',
    components:{
       LTable,contractTemplateEdit,contractTemplateAdd
    },
    mixins:[SysMixin],
    data(){
        return{
            initDictCodes:defaultSettings.数据字典.合同类型,
            defaultSettings,
            formAttributes:[
                
                {field:'empName',label:'人员姓名',component:'input',condition:'like'},
                {field:'accountNo',label:'账号',component:'input',condition:'like'},
            ],
         
            columns:[
                // {
                //     title: '序号',
                //     dataIndex: '',
                //     key:'rowIndex',
                //     width:60,
                //     align:"center",
                //     customRender:function (t,r,index) {
                //       return parseInt(index)+1;
                //     }
                // },
                 {
                    title: '合同类型',
                    dataIndex: 'contractType',
                    customRender:(text)=>{
                        if(!text){
                            return ''
                        }else{
                            return this.dictText(defaultSettings.数据字典.合同类型,text)
                        }
                    }
                },
                
                {
                    title: '备注',
                    dataIndex: 'templateDesc'
                },
                {
                    title: '操作',
                    dataIndex: 'action',
                    width: '120px',
                    scopedSlots: { customRender: 'action' }
                }
            ],
            
        }
    },
    created(){
       
    },
    methods:{
       
      
    }
}
</script>